<!DOCTYPE html>
<html>
<head>
	<title>管理 —— 充值，销售记录</title>
	<link rel="stylesheet" href="/static/css/base.css" type="text/css" />
	<link rel="stylesheet" href="/static/css/caipiao_3.css" type="text/css" />
	<link rel="stylesheet" href="/static/css/icon.css" type="text/css" />
	<link rel="stylesheet" href="/static/css/hjh.css" type="text/css" />
	<link rel="stylesheet" href="/static/css/caipiao.css" type="text/css" />
    <link rel="stylesheet" href="/static/css/caipiao_1.css" type="text/css" />
    <link rel="stylesheet" href="/static/css/easydialog.css" type="text/css" />
	<script src="/static/js/easydialog.js" type="text/javascript"></script>
  	<script src="/static/js/jquery.min.js" type="text/javascript"></script>
  	<script src="/static/js/pyqtmock.js" type="text/javascript"></script>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>

<body oncontextmenu="return false">
 <div id="guanli_denglu">
    <span class="guanli_denglu_logo"></span>
    <span class="guanli_title1"></span>
    <div class="back_img right" onclick="window.location.href='/'"></div>
 </div>
    <div class="gg" >
      <div id="chzh" style="float:left">
      	<a href="/show_recharge">
        	<img src="../static/img/qianbi.png" class="guanli_icon"/>	
         	<!-- <img src="../static/img/yinka.png" style="margin-left:-60px;"/> -->
         	<br> <img src="../static/img/recharge.png" style="margin-top:10px;"/>
        </a>
      </div>
      
      <div id="info" class="guanli_func">
      	<a href="#">
        	<img src="../static/img/history_info1.png" class="guanli_icon"/>
<!--         	<img src="../static/img/fangda.png" class="guanli_icon" style="margin-left:-100px;"/>
 -->        	<br><img src="../static/img/recorde.png" style="margin-top:10px;"/>
        </a>
      </div>
      
      <div id="zhj_check" class="guanli_func">
      	<a href="#" >
        	<img src="../static/img/guanli_zhj6.png" class="guanli_icon"/>
       		<br><img src="../static/img/lookup.png" style="margin-top:10px;"/>
       	</a>
      </div>
      
      <div id="test_print" class="guanli_func">
      	<a href="#" >
        	<img src="../static/img/printer.png" class="guanli_icon"/>
       		<br><img src="../static/img/print_test.png" style="margin-top:13px;"/>
       	</a>
      </div>
    </div>
    
    <div class="gg" style="margin-top:10px;">
    	<div id="moneybox" style="float:left;">
	      	<a href="#" >
	        	<img src="../static/img/money_box.png" class="guanli_icon"/>
	       		<br><img src="../static/img/money_box_tip.png" style="margin-top:10px;"/>
	       	</a>
      </div>
      
      <!-- 银联签到
      <div id="signin" class="guanli_func"> 
      	<a href="#" >
        	<img src="../static/img/china_union_pay.png" class="guanli_icon"/>
       		<br><img src="../static/img/signin_tip.png" style="margin-top:13px;"/>
       	</a>
      </div>
       
      <div id="signout" class="guanli_func">  银联签退
      	<a href="#" >
        	<img src="../static/img/china_union_pay.png" class="guanli_icon"/>
       		<br><img src="../static/img/signout_tip.png" style="margin-top:13px;"/>
       	</a>
      </div>
      <div id="balance" class="guanli_func"> 银联结算 
      	<a href="#" >
        	<img src="../static/img/china_union_pay.png" class="guanli_icon"/>
       		<br><img src="../static/img/balance_tip.png" style="margin-top:13px;"/>
       	</a>
      </div>
      -->
      <div id="poweroff" class="guanli_func"> <!-- 关机 -->
      	<a href="#" >
        	<img src="../static/img/poweroff.png" class="guanli_icon"/>
       		<br><img src="../static/img/poweroff_tip.png" style="margin-top:13px;"/>
       	</a>
      </div>
    </div>
   
<div class="daigou_1" style="display:none;height:120px;" id="check_moneybox">
	<div class="daigou_11" style="height:120px;">
    	<a class="close" onclick="easyDialog.close();"></a>
    	<div class="daigou-info">钱箱硬币总额：<span class="like-red pay_num" id="moneybox_amount">0</span>元
    		<input type="button" value="清空钱箱" class="beauty_button" id="clearbtn"></div>
    	<div style="font-size: 0.5em;padding-left: 214px;padding-top: 18px;"><span id="check_time2">5</span>秒后返回主界面</div>
    </div>
</div>

<div class="toubi_1" style="display:none;height: 111px;width:429px;top:-126px;" id="confirm_div">
	<div class="toubi_11" style="height: 111px">
		<a onclick="easyDialog.close();" class="close"></a>
		<div class="daigou-info">是否确定关机？
    		<input type="button" value="是" class="beauty_button" id="confirmBtn">
    	</div>
		<div class="goback" style="padding-left:191px;padding-top:27px;"><span id="confirm_time">2</span>秒后返回主界面</div>
	</div>
</div>


<div class="daigou_1" style="display:none;height:180px;" id="balance_div">
	<div class="daigou_11" style="height:180px;">
    	<a class="close" onclick="easyDialog.close();"></a> 
    	<div class="daigou-info">
    		<div>未结算交易数：<span class="like-red pay_num" id="trans_nums">0</span> 笔交易</div>
    		<div>未结算交易额：<span class="like-red pay_num" id="trans_amount">0</span> 元</div>
    		<br>
    		<input type="button" value="结算" class="beauty_button" id="balancebtn"></div>
    	<div style="font-size: 0.5em;padding-left: 214px;padding-top: 18px;"><span id="balance_time">100</span>秒后返回主界面</div>
    </div>
</div>

<div class="toubi_1" style="display:none;height: 111px;width:429px;top:-126px;" id="err_msg2">
	<div class="toubi_11" style="height: 111px">
		<a onclick="easyDialog.close();" class="close"></a>
		<div class="print-ok"><span class="like-red" id="msg_content" style="font-weight:bold; font-family:Microsoft yahei">请取走并保存好您的彩票</span></div>
		<div class="goback" style="padding-left:191px;padding-top:27px;"><span id="tip_time">2</span>秒后返回主界面</div>
	</div>
</div>

<div class="daigou_1" style="display:none;height:200px;" id="check">
  <div class="daigou_11" style="height:200px;">
    <a onclick="easyDialog.close();" class="close"></a>
    <div class="daigou-info2">请输入彩票条形码：<br><br>
        <table><tr><td><input id="batchid"  class="input" maxlength="12"></td>
               <td><a id="check_ok" class="daigou_ok-button"></a></td></tr>
        </table>
    </div>
    <div style="font-size: 0.5em;padding-left: 214px;padding-top: 18px;"><span id="check_time">100</span>秒后返回主界面</div>
  </div>

  <div id="check_batchid" class="input_keybord" style="display:none;top: -290px;left:-195px">
    <i class="bottom"><span>7</span></i>
    <i class="bottom"><span>8</span></i>
    <i class="bottom"><span>9</span></i>
    <br>
    <i class="bottom"><span>4</span></i>
    <i class="bottom"><span>5</span></i>
    <i class="bottom"><span>6</span></i>
    <br>
    <i class="bottom"><span>1</span></i>
    <i class="bottom"><span>2</span></i>
    <i class="bottom"><span>3</span></i>
    <br>
    <i class="bottom"><span>0</span></i>
    <i class="dele"><span></span></i>
    <i class="rest"><span></span></i>
  </div>
</div>

   
</body>
</html>
<script type="text/javascript">

function start_dialog2(id,autocount,countid,callback){
    callback = callback || function(){};
    autocount = autocount || 0;
    countid = countid || null;
    easyDialog.close();
    easyDialog.open({
        container : id,
            fixed : true,
            callback: callback,
            autocount : autocount,  //开启倒计时
            countid : countid
    });
}

	$('#test_print').click(function(){
		pyObj.test_print();
	});
     
     $('#zhj_check').click(function(){
            self.start_dialog2('check',100,'check_time');
            $('#batchid').val(''); 
            $('#batchid').focus();
        });
     $('#batchid').click(function(){$('#check_batchid').show();});
     
     //软键盘数字键
     $('i.bottom').click(function(){
         $('#batchid').val($('#batchid').val()+$(this).children().html());
     });

   //软键盘删除键
     $('i.dele').click(function(){
         var c = $('#batchid').val();
         $('#batchid').val(c.slice(0,c.length-1));
     });

     //软键盘清空键
     $('i.rest').click(function(){
        $('#batchid').val(''); 
     });
     
  
     //中奖查询按钮
     $('#check_ok').click(function(){
    		var batchid = document.getElementById("batchid").value;
    		mac=pyObj.get_if_mac()
    		window.location.href = '/zhongjiang/'+batchid+'|'+mac+'|input';
     });
     
     $('#moneybox').click(function(){
    	 amount = pyObj.countMoneyBox();
    	 $("#moneybox_amount").html(amount);
    	 start_dialog2('check_moneybox',5,'check_time2');
     });
     
     //签到函数 
     $('#signin').click(function(){
    	 result = pyObj.yeepay_signin();
    	 if(result){
    		 $("#msg_content").html("签到成功");
    	 }else{
    		 $("#msg_content").html("签到失败，请重新签到");
    	 }
    	 start_dialog2('err_msg2',2,'tip_time');
     });
     
     //签退函数 
     $('#signout').click(function(){
    	 result = pyObj.yeepay_signout();
    	 if(result){
    		 $("#msg_content").html("签退成功");
    	 }else{
    		 $("#msg_content").html("签退失败，请重新签退");
    	 }
    	 start_dialog2('err_msg2',2,'tip_time');
     });
     
     trans_nums = '0'
     trans_amount = '0'
     
     //银联卡支付结算函数
     $('#balancebtn').click(function(){
    	 result = pyObj.yeepay_balance(trans_nums,trans_amount);
    	 if(result){
    		 $("#msg_content").html("结算成功");
    	 }else{
    		 $("#msg_content").html("结算失败，请重新结算");
    	 }
    	 start_dialog2('err_msg2',2,'tip_time');
     });
     //结算函数 
     $('#balance').click(function(){
    	 result = pyObj.yeepay_balance_info();
    	 banlance_info = result.split('#')
    	 trans_nums = banlance_info[0] //交易笔数
    	 trans_amount = banlance_info[1] //交易总金额
    	 $('#trans_nums').html(trans_nums)
    	 $('#trans_amount').html(trans_amount)
    	 self.start_dialog2('balance_div',100,'balance_time'); 
     });
     
     //关机函数 
     $('#poweroff').click(function(){
    	 start_dialog2("confirm_div",20,'confirm_time');
     });
     
     $('#confirmBtn').click(function(){
    	 $("#msg_content").html("正在关机...");
    	 start_dialog2('err_msg2',20,'confirm_time');
    	 result = pyObj.poweroff();
    	 if(!result){
    		 $("#msg_content").html("关机失败，请重试");
        	 start_dialog2('err_msg2',20,'tip_time');
    	 }
     });
     
     function doClear(){
    	 result = pyObj.clearMoneyBox();
    	 if(result){
    		 alert("钱箱已经清空")
    	 }else{
    		 alert('钱箱清空失败')
    	 }
     }
     
     $("#clearbtn").click(function(){
    	 easyDialog.open({
   		  container : {
   		    header : '清空确认',
   		    content : '清空前需要将钱箱中硬币取走，确定清空?',
   		    yesFn : doClear,
   		    noFn : true
   		  }
   		}); 
     });
     
     $('#info').click(function(){
 		mac=pyObj.get_if_mac()
 		window.location.href = '/sale_info/1/'+mac;
  });
</script>